\(\int \frac {\csc ^2(a+b \log (c x^n))}{x} \, dx\) [296]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 19 \[ \int \frac {\csc ^2\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=-\frac {\cot \left (a+b \log \left (c x^n\right )\right )}{b n} \]

[Out]

-cot(a+b*ln(c*x^n))/b/n

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {3852, 8} \[ \int \frac {\csc ^2\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=-\frac {\cot \left (a+b \log \left (c x^n\right )\right )}{b n} \]

[In]

Int[Csc[a + b*Log[c*x^n]]^2/x,x]

[Out]

-(Cot[a + b*Log[c*x^n]]/(b*n))

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \csc ^2(a+b x) \, dx,x,\log \left (c x^n\right )\right )}{n} \\ & = -\frac {\text {Subst}\left (\int 1 \, dx,x,\cot \left (a+b \log \left (c x^n\right )\right )\right )}{b n} \\ & = -\frac {\cot \left (a+b \log \left (c x^n\right )\right )}{b n} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00 \[ \int \frac {\csc ^2\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=-\frac {\cot \left (a+b \log \left (c x^n\right )\right )}{b n} \]

[In]

Integrate[Csc[a + b*Log[c*x^n]]^2/x,x]

[Out]

-(Cot[a + b*Log[c*x^n]]/(b*n))

Maple [A] (verified)

Time = 1.03 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.05

method result size
derivativedivides \(-\frac {\cot \left (a +b \ln \left (c \,x^{n}\right )\right )}{b n}\) \(20\)
default \(-\frac {\cot \left (a +b \ln \left (c \,x^{n}\right )\right )}{b n}\) \(20\)
parallelrisch \(\frac {-\cot \left (\frac {a}{2}+b \ln \left (\sqrt {c \,x^{n}}\right )\right )+\tan \left (\frac {a}{2}+b \ln \left (\sqrt {c \,x^{n}}\right )\right )}{2 b n}\) \(42\)
risch \(-\frac {2 i}{b n \left (\left (x^{n}\right )^{2 i b} c^{2 i b} {\mathrm e}^{-b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}} {\mathrm e}^{b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )} {\mathrm e}^{b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}} {\mathrm e}^{-b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )} {\mathrm e}^{2 i a}-1\right )}\) \(118\)

[In]

int(csc(a+b*ln(c*x^n))^2/x,x,method=_RETURNVERBOSE)

[Out]

-cot(a+b*ln(c*x^n))/b/n

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.79 \[ \int \frac {\csc ^2\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=-\frac {\cos \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )}{b n \sin \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )} \]

[In]

integrate(csc(a+b*log(c*x^n))^2/x,x, algorithm="fricas")

[Out]

-cos(b*n*log(x) + b*log(c) + a)/(b*n*sin(b*n*log(x) + b*log(c) + a))

Sympy [F]

\[ \int \frac {\csc ^2\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\int \frac {\csc ^{2}{\left (a + b \log {\left (c x^{n} \right )} \right )}}{x}\, dx \]

[In]

integrate(csc(a+b*ln(c*x**n))**2/x,x)

[Out]

Integral(csc(a + b*log(c*x**n))**2/x, x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 168 vs. \(2 (19) = 38\).

Time = 0.23 (sec) , antiderivative size = 168, normalized size of antiderivative = 8.84 \[ \int \frac {\csc ^2\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {2 \, {\left (\cos \left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right ) \sin \left (2 \, b \log \left (c\right )\right ) + \cos \left (2 \, b \log \left (c\right )\right ) \sin \left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )\right )}}{2 \, b n \cos \left (2 \, b \log \left (c\right )\right ) \cos \left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right ) - {\left (b \cos \left (2 \, b \log \left (c\right )\right )^{2} + b \sin \left (2 \, b \log \left (c\right )\right )^{2}\right )} n \cos \left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )^{2} - 2 \, b n \sin \left (2 \, b \log \left (c\right )\right ) \sin \left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right ) - {\left (b \cos \left (2 \, b \log \left (c\right )\right )^{2} + b \sin \left (2 \, b \log \left (c\right )\right )^{2}\right )} n \sin \left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )^{2} - b n} \]

[In]

integrate(csc(a+b*log(c*x^n))^2/x,x, algorithm="maxima")

[Out]

2*(cos(2*b*log(x^n) + 2*a)*sin(2*b*log(c)) + cos(2*b*log(c))*sin(2*b*log(x^n) + 2*a))/(2*b*n*cos(2*b*log(c))*c
os(2*b*log(x^n) + 2*a) - (b*cos(2*b*log(c))^2 + b*sin(2*b*log(c))^2)*n*cos(2*b*log(x^n) + 2*a)^2 - 2*b*n*sin(2
*b*log(c))*sin(2*b*log(x^n) + 2*a) - (b*cos(2*b*log(c))^2 + b*sin(2*b*log(c))^2)*n*sin(2*b*log(x^n) + 2*a)^2 -
 b*n)

Giac [F]

\[ \int \frac {\csc ^2\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\int { \frac {\csc \left (b \log \left (c x^{n}\right ) + a\right )^{2}}{x} \,d x } \]

[In]

integrate(csc(a+b*log(c*x^n))^2/x,x, algorithm="giac")

[Out]

integrate(csc(b*log(c*x^n) + a)^2/x, x)

Mupad [B] (verification not implemented)

Time = 29.77 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.53 \[ \int \frac {\csc ^2\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=-\frac {2{}\mathrm {i}}{b\,n\,\left ({\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\left (c\,x^n\right )}^{b\,2{}\mathrm {i}}-1\right )} \]

[In]

int(1/(x*sin(a + b*log(c*x^n))^2),x)

[Out]

-2i/(b*n*(exp(a*2i)*(c*x^n)^(b*2i) - 1))